package cn.baiweigang.uu.enums;

public enum MarginModeEnum {

    CROSS("cross", "全仓模式"),
    ISOLATED("isolated", "逐仓模式"),
    ;

    private String code;
    private String desc;

    MarginModeEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static MarginModeEnum byCode(String code) {
        MarginModeEnum[] directionEnums = MarginModeEnum.values();
        for (int i = 0; i < directionEnums.length; i++) {
            if (directionEnums[i].getCode().equalsIgnoreCase(code)) {
                return directionEnums[i];
            }
        }
        return null;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
